import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-account',
  templateUrl: './account.component.html',
  styleUrls: ['./account.component.less'],
})
export class AccountComponent implements OnInit {
  filter: { [key: string]: string } = {};
  listOfRole = [];
  listOfStatus = [
    { text: '启用', value: 0 },
    { text: '禁用', value: 1 },
  ];
  isVisible = false;
  eidtData = null;
  loading = false;
  loadingOfSwitch = false;

  listOfData: any[] = [];

  constructor(
  ) {}

  ngOnInit(): void {
    this.search(true);
  }

  search(bool: boolean): void {
    this.loading = true;
  }

  onNavToAdd(): void {
    this.eidtData = null;
    this.isVisible = true;
  }

  onNavToEdit(data: any): void {
    this.eidtData = data;
    this.isVisible = true;
  }

  onDelete(id: string): void {
  }

  onResetPwd(id: string): void {
  }

  onEditCancel(bool: boolean): void {
    this.eidtData = null;
    this.isVisible = false;
    if (bool) {
      this.search(true);
    }
  }

  onClickSwitch(data: Account): void {
  }
}
